<%@include file="/WEB-INF/jsp/common/taglibs.jsp" %>

<script src="${pageContext.request.contextPath}/resources/components/ckeditor/ckeditor.js"></script>

<script type="text/javascript">
    window.onload = function() {
        CKEDITOR.replace( 'inputDocumento' );
    };
</script>

<a href="${pageContext.request.contextPath}" class="btn btn-primary"><spring:message code="btn.volver"/></a>
<div class="page-header">
     <h2><spring:message code="nuevo.documento"/><small><spring:message code="nuevo.complete"/></small></h2>
</div>

<form:form commandName="document" action="${pageContext.request.contextPath}/document">
	<form:hidden path="id"/>
	<div class="form-group">
		<label for="inputTitulo"><spring:message code="nuevo.titulo"/></label>
 		<form:input path="title" class="form-control" id="inputTitulo" placeholder="Ingrese Titulo" required="required" onchange="$('#inputTags').html(this.value)"/>
	</div>
	<div class="form-group">
		<label for="inputDescripcion"><spring:message code="nuevo.descripcion"/></label>
		<form:input path="descripcion"  class="form-control" id="inputDescripcion" placeholder="Ingrese Descripcion" required="required"/>
	</div>
	<div class="form-group">
		<label for="inputTags"><spring:message code="nuevo.tags"/></label>
		<form:input path="tags"  class="form-control" style="text-transform: lowercase" id="inputTags" placeholder="Ingrese Tags de Búsqueda" required="required"/>
	</div>
	<div class="form-group">
		<label for="inputDocumento"><spring:message code="nuevo.instructivo"/></label>
		<form:textarea path="inputDocumento" class="form-control" id="inputDocumento" required="required"/>
	</div>
	<div class="form-group">
		<input type="submit" class="btn btn-primary" value="<spring:message code='btn.guardar'/>"/>
	</div>
</form:form>

<script type="text/javascript">

	$('#inputTags').tagsInput({
		   'height':'34px',
		   'width':'100%',
		   'interactive':true,
		   'defaultText':'',
		   'removeWithBackspace' : true
		});
	
</script>
